<?php

include '../../init.php';

$modulID = $_GET['modulID'];
// 获取板块列表
$data = array();
$sql  = "SELECT zid,title FROM zone_modul_tb WHERE parentid=(SELECT parentid FROM ";
$sql .= "zone_modul_tb WHERE zid={$modulID}) AND status!=0;";
if (my_mysql_query($sql, $data) === false){
	echo '数据加载失败';
	exit();
}

?>

<!DOCTYPE html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>发表帖子</title>
    <meta name="keywords" content="">
    <meta name="description" content=",机锋论坛">
    <link rel="stylesheet" type="text/css" href="./css/style_3_common.css">
    <link rel="stylesheet" type="text/css" href="./css/style_3_forum_post.css">
    <!--首页不显示宽屏(gfan)-->
    <link rel="stylesheet" id="css_widthauto" type="text/css" href="./css/style_3_widthauto.css">
    <link rel="stylesheet" type="text/css" id="gfan_css" href="./css/gfan_bbs.css">
    <style type="text/css">
    *{
        margin: 0px;
        padding: 0px;
    }
    .right-pl{
        width: 25%;
        height: 420px;
        border: 1px solid gray;
        margin-top: 30px;
        margin-left: 20px;
        line-height: 48px;
        text-indent: 2em;
    }
    .main-div{
        width:960px;
        margin:25px auto;
        background:rgb(240,240,240);
    }
    body{
        background-color:#F9F9F9;
    }
    form{
        background-color: rgba(240,240,240,0.5);
        padding: 15px;
    }
    </style>
</head>

<body id="nv_forum" class="pg_post">
    <div class="main-div">
        <div id="pt">
            <div class="z">
                <a href="../../index.php">首页</a><em>›</em> 发表帖子
            </div>
            <br />
			
			<link rel="stylesheet" href="../../plugins/kindeditor/themes/default/default.css" />
			<link rel="stylesheet" href="../../plugins/kindeditor/plugins/code/prettify.css" />
			<script charset="utf-8" src="../../plugins/kindeditor/kindeditor.js"></script>
			<script charset="utf-8" src="../../plugins/kindeditor/lang/zh_CN.js"></script>
			<script charset="utf-8" src="../../plugins/kindeditor/plugins/code/prettify.js"></script>
			<script>
				KindEditor.ready(function(K) {
					var editor1 = K.create('textarea[name="content"]', {
						resizeType: 0,
						cssPath : '../../plugins/kindeditor/plugins/code/prettify.css',
						uploadJson : '../../plugins/kindeditor/php/upload_json.php',
						fileManagerJson : '../../plugins/kindeditor/php/file_manager_json.php',
						allowFileManager : true,
						afterCreate : function() {
							var self = this;
							K.ctrl(document, 13, function() {
								self.sync();
								K('form[name=example]')[0].submit();
							});
							K.ctrl(self.edit.doc, 13, function() {
								self.sync();
								K('form[name=example]')[0].submit();
							});
						}
					});
					prettyPrint();
				});
			</script>
            <form action="../mod_list/post.php" method="post" enctype="multipart/form-data">
				<input type="hidden" name="action" value="post">
                <!-- 发表文章 -->
                <div class="ptm">
                    <div>
                        标题:
                        <input type="text" size="60" name="title" value="">
						板块:
						<select name="modulID">
							<?php
							foreach($data as $value){
								echo '<option value="'.$value['zid'].'"'.($value['zid']==$modulID?'selected':'').'>'.$value['title'].'</option>';
							}
							?>
						</select>
                    </div>
                    <div>内容:
                        <br />
                        <textarea name="content" style="width:95%;height:300px;"></textarea>
                    </div>
					
                </div>
                <div class="mtm mbm pnpost">
					
				<?php
                if (@$_SESSION['isStop']) {
                    echo '<span>你被禁言了</span>';
                } else if (@$_SESSION['is_login']){
                    echo '<button type="submit"><span>发表帖子</span></button>';
				} else {
					echo '需要登录后才能发帖';
				}
				?>
                </div>
            </form>
        </div>
    </div>
</body>

</html>
